//
//  MyBankCartCell.m
//  NtoccShipper
//
//  Created by zcj on 2021/9/14.
//  Copyright © 2021 zhuchongjin. All rights reserved.
//

#import "MyBankCartCell.h"

@interface MyBankCartCell()
@property (nonatomic,strong) CJLabel *labNameAndBankNum;
@property (nonatomic,strong) CJLabel *labBankName;
@property (nonatomic,strong) CJLabel *labBankStatus;
@end

@implementation MyBankCartCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setCellInfoWithModel:(MyBankCartModel *)model{
    
    self.labNameAndBankNum.textColor = [UIColor cjMainTextColor];
    self.labBankName.textColor = [UIColor cjMainTextColor];

    if (model.isDefault == 1) {
        self.labNameAndBankNum.text = CJStringWithFormat(@"%@ - %@(默认)",model.name,model.account);
    }else{
        self.labNameAndBankNum.text = CJStringWithFormat(@"%@ - %@",model.name,model.account);
    }
    self.labBankName.text = model.bankName;
    
//云企付绑卡状态:0:默认未绑卡，1：绑卡中，2：待验证，3：已成功，4：已失败"
//  bindCardStatus;
    NSString *strBindCardStatus = @"";
    switch (model.bindCardStatus) {
        case 0:
            strBindCardStatus = @"待审核";
            break;
        case 1:
            strBindCardStatus = @"处理中";
            break;
        case 2:
            strBindCardStatus = @"待验证";
            break;
        case 3:
            strBindCardStatus = @"已绑卡";
            break;
        case 4:
            strBindCardStatus = CJStringWithFormat(@"已失败,%@",[CJControl getThreeUnaryValueStr:model.bindCardFailReason]);
            break;
        default:
            break;
    }
    
    self.labBankStatus.text = strBindCardStatus;
    self.labBankStatus.textColor = model.bindCardStatus == 3 ?  CJRGB16Color(0x40A9EF):[UIColor cjRedColor];

    
}


@end
